<template>
  <el-button @click="open" type="primary">打开</el-button>
  <m-dialog ref="dialog">
    <template #default="{data}">
      <m-form :item="data" :view="view" :db="meta.db"></m-form>
    </template>
  </m-dialog>
</template>

<script setup lang="ts">
import {reactive, ref} from "vue";
import {useMorghulisDao} from "../../morghulis/tools/dao_morghulis.ts";
import type {QueryBean} from "../../morghulis/tools/query.ts";
import type {Meta} from "../../morghulis/types/tool/meta.types.ts";

const table = ref()
const includes = ref({name: null})
const queryBean = reactive<QueryBean>({size: 10, page: 1, includes: includes.value})
const meta = reactive<Meta>({db: 'orm', entity: 'data.Vala', code: 'default'})

const dialog = ref()

const {
  results, view, loading, load
} = useMorghulisDao(meta, queryBean)

function open() {
  dialog.value.open(results.value[0])
}

</script>
